<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文档碎片优化节点添加</title>
</head>
<body>
  <script>
    const frag = document.createDocumentFragment()
    for(var i = 0; i < 10; i++) {
      var op = document.createElement('p')
      op.innerHTML = i
      frag.appendChild(op)
    }
    document.body.appendChild(frag)
  </script>
</body>
</html>